import './assets/main.css'

import { createApp, createVNode } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as echarts from 'echarts';
import * as Icons from '@element-plus/icons-vue'
import zhCn from "element-plus/es/locale/lang/zh-cn"

// 修改分页器默认文字
zhCn.el.pagination.total = "总共：" + `{total}` + "条"
zhCn.el.pagination.goto = "跳转至"

const app = createApp(App)
// 创建Icon组件
const Icon = (props: { icon: string }) => {
    const { icon } = props
    return createVNode(Icons[icon as keyof typeof Icons])
}
app.use(createPinia())
app.use(router)
app.use(ElementPlus, { size: 'small', zIndex: 3000, locale: zhCn })
app.config.globalProperties.$echarts = echarts;
app.component('Icon', Icon)
app.mount('#app')